

package com.scs.application.modules.order.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.scs.application.core.model.DataEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 发货单实体对象
 *
 */
@TableName("delivery")
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
public class Delivery extends DataEntity implements Serializable {

    /**
     * 院方ID
     */
    private String hospitalId;

    /**
     * 院方名称
     */
    private String hospitalName;

    /**
     * 发货单号
     */
    private String code;

    /**
     * 订单ID
     */
//    @NotNull(message = "订单ID不能为空")
    private String poId;

    /**
     * 采购单号
     */
//    @NotBlank(message = "采购单号不能为空")
//    @Length(min = 1, max = 50, message = "采购单号长度必须介于 1 和 50 之间")
    private String poCode;

    /**
     * 供应商ID
     */
    private String supplierId;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     *  送达地点id
     */
    private String warehouseId;

    /**
     *  送达地点名称
     */
    private String warehouseName;


    /**
     * 是否手工发货单
     */
    private Integer isManual;

    /**
     * 是否寄售
     */
    private String isConsignment;

    /**
     * 是否一物一码
     */
    private String isOneThingOneYard;

    /*** 送达日期*/
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date gmtRequireLatestDelivery;

    /**
     * 预计最早送达日期
     */
//    @Future(message = "最早送达日期不能早于当前时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date gmtExceptedEarliestDelivery;

    /**
     * 预计最晚送达日期
     */
//    @Future(message = "最晚送达日期不能早于当前时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date gmtExceptedLatestDelivery;

    /**
     * 实际送达日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date gmtActualDelivery;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtAudited;
    /**
     * 订单金额(元)
     */
    //@NotNull(message = "订单金额(元)不能为空")
    private Double orderAmount;

    /**
     * 发货金额(元)
     */
    private Double deliveryAmount;

    /**
     * 发货时间
     */
    @TableField(strategy = FieldStrategy.IGNORED)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    private java.util.Date gmtDelivery;

    /**
     * 状态
     */
    private String status;

    /** 是否关闭 */
    private Integer isClosed;

    /** 关闭原因 */
    private String closedReason;

    private String remark;


    /**  供应商移动电话 */
    @TableField(exist = false)
    private String mobile;

    /** 供应商联系人 */
    @TableField(exist = false)
    private String contactor;

    /** 需求科室Id */
    private String demandDeptId;

    @TableField(exist = false)
    private String materialCodes;


    /** 需求科室Name */
    private String demandDeptName;

    /** 采购日期 */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private Date purchaseDate;

    /** udi必填 */
    @TableField(exist = false)
    private Boolean udiNecessary;

    /** 打印默认纸张大小 */
    @TableField(exist = false)
    private String printDefaultSize = "A4";

    /** 采购科室Id */
    private String purchaseDeptId;

    /** 采购科室Name */
    private String purchaseDeptName;

    /**1：药品，2：耗材，3：试剂 4:跟台包 默认耗材 **/
    private String materialTypeCode;

    /** 温度 **/
    private String temperature;

    /** 跟台包名称  **/
    private String packageName;

    /* 第三方订单id */
    private String thirdDeliveryId;

    //发货人
    @TableField(exist = false)
    private String sendUser;

    //发货人联系电话
    @TableField(exist = false)
    private String sendMobile;

    //发货地址
    @TableField(exist = false)
    private String sendAddress;

    //物流公司
    private String logcName;

    //物流单号
    private String logcCode;

    //收货人
    @TableField(exist = false)
    private String receiveUser;

    //收货人联系电话
    @TableField(exist = false)
    private String receivePhone;

    //收货人收货地址
    @TableField(exist = false)
    private String receiveAddress;

    @TableField(exist = false)
    private String msgReturn;

}
